<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8" />
    <title>登录-天天装机</title>
    <meta name="applicable-device" content="pc">
<link rel="stylesheet" href="forum.css" th:href="@{/asserts/css/login.css}" />
</head>
<body>

<div class="nav-header">
   <div class="logo">
      <img src="computer1.png" th:src="@{/asserts/img/computer1.png}" />
   </div>
</div>
<div class="loginbox">
<h1 data-color="red" th:text="${msg}" th:if="${not #strings.isEmpty(msg)}"></h1>
  <form method="post" action="" name="login">
    <input type="text" name="name" class="txt" placeholder="用户名"><br>
    <input type="password" name="password" class="txt" placeholder="密码"><br>
    <div class="btnbox">
      <button class="btn" onclick="normal()">登录</button><br>
      <button class="btn" onclick="abnormal()">管理员登录</button><br>
      <a th:href="@{/register}" class="link">新用户注册</a>
    </div>
  </form>
  </div>
</body>
<script th:inline="javascript">
    var login=[[@{/login}]]
    var admin=[[@{/admin/login}]]
    function normal() {
        document.login.action=login;
        document.login.submit();
    }
    function abnormal() {
        document.login.action=admin;
        document.login.submit();
    }


</script>
</html>
